package com.ms.demo;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @description: 创建一个中介类  chatRoom 聊天室类
 * @author: ms
 * @create: 2022-10-28 10:43
 */
public class ChatRoom {

    public static void showMessage(User user, String message){
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(format.format(new Date()) + " [" + user.getName() +"] : " + message);
    }
}